package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.mapper.RoomMapper;
import com.whw.fy.entity.Room;
import com.whw.fy.service.RoomService;import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {

    @Resource
    private RoomMapper roomMapper;

    @Override
    public Message deleteByPrimaryKey(Integer roomId) {
        return roomMapper.deleteByPrimaryKey(roomId) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insert(Room record) {
        return roomMapper.insert(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message insertSelective(Room record) {
        return roomMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer roomId) {
        return Message.success(null).add(roomMapper.selectByPrimaryKey(roomId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Room record) {
        return roomMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Room record) {
        return roomMapper.updateByPrimaryKey(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(roomMapper.selectAll());
    }

    @Override
    public int batchInsert(List<Room> list) {
        return roomMapper.batchInsert(list);
    }
}

